<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/static/layuiadmin/style/admin.css}" media="all">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">修改密码</div>
                <div class="layui-card-body" pad15>
                    <div class="layui-form" lay-filter="">
                        <form class="layui-form myData layui-form-pane" lay-filter="stuform" >
                            <div class="layui-form-item">

                                <div class="layui-inline">
                                    <label class="layui-form-label">原密码：</label>
                                    <div class="layui-input-inline">
                                        <input type="password" name="oldPwd" lay-verify="required" id="oldPwd"
                                               placeholder="请输入原密码" class="layui-input"/>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">新密码：</label>
                                    <div class="layui-input-inline">
                                        <input type="password" name="newPwd" lay-verify="required" id="newPwd"
                                               placeholder="请输入新密码"  class="layui-input"/>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">确认密码：</label>
                                    <div class="layui-input-inline">
                                        <input type="password" name="affirmPwd" lay-verify="required" id="affirmPwd"
                                               placeholder="请确认新密码"  class="layui-input"/>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button type="button" class="layui-btn" lay-submit lay-filter="setmyinfo">确认修改</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/static/layui/layui.js}"></script>
<script type="text/javascript">
    layui.config({
        base: '../../static/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','jquery'],function () {
        var form=layui.form,
            $ = layui.jquery;

        form.on('submit(setmyinfo)', function (data) {
            $.post("changePwd",data.field,function (result) {
                if(!result.success){
                    layer.msg(result.msg);
                }
                layer.msg(result.msg)
            })

        })
    });
    
</script>
</body>
</html>